{extends file="./main.tpl"}
{block name=head}
<script type="text/javascript">
$(document).ready(function() {
  $('#fromId').focus();
  if({$invoiceNo} != '' )
  {
  	loadUpload();
  }
});	
function loadUpload()
{
	if($('#invoiceNo').val() != '')
	{
	  var dataString = "fromId=" + $('#fromId').val() + "&invoiceNo=" + $('#invoiceNo').val();
	 	$.ajax({
			type: "GET",
			url: "setLoadingData.php",
			data: dataString,
			success:function(data){
				if(data == 1)
				{
					alert("Wrong Invoice No !");
					$('#invoiceNo').val('')
				}
				else
				{
				  $(".getUnload").html(data);
				}
	    }
	  });
	}
}
</script>
{/block}
{block name=body}
<form name="unloadingregister" action="{$smarty.server.PHP_SELF}" method="POST">
<table align="center" border="2" cellpadding="2" cellspacing="2" width="" >
<tr>
  <td align="center" class="table1" colspan="16"><b>Unloading Register (Bill Register)</b></td>
</tr>
<tr>
	<td align="center" class="table2">FROM
    <select name="unloadfrom" id="fromId" autofocus />
      {html_options values=$branchArray.branchId output=$branchArray.branchName}
    </select>
  </td>
  <td class="table2" align="center" colspan="3" >Loading Inv. No.
    <input type="text" name="invoiceNo" id="invoiceNo" {if $invoiceNo > 0 } value="{$invoiceNo}" {/if}onblur="loadUpload();"  />
  </td>
</tr>
</table>
</form>
<div class="getUnload"></div>
<br /><br />
{/block}